package com.tsunami.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tsunami.authority.enums.admin.MoldType;
import com.tsunami.base.entity.Entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;

/**
 * <p>
 * 角色表 和租户无关；角色只关联应用
 * </p>
 *
 * @author lx
 * @since 2021-09-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("tnm_auth_role")
@Schema(description = "角色")
public class Role extends Entity<Long> {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "租户号")
    @TableField(value = "tenant_id")
    private Long tenantId;

    @Schema(description = "角色名称")
    @TableField(value = "name")
    private String name;

    @Schema(description = "角色编码")
    @TableField(value = "code")
    private String code;

    @Schema(description = "角色描述")
    @TableField(value = "describe_")
    private String describe;

    @Schema(description = "是否启用状态")
    @TableField(value = "status")
    private Boolean status;

    @Schema(description = "是否内置角色")
    @TableField(value = "readonly")
    private Boolean readonly;

    @Schema(description = "数据范围(1全部2本级及子级3本级4个人)")
    @TableField(value = "scope")
    private String scope;

    /**
     * 所属行业类型
     */
    @Schema(description = "角色所属行业类型")
    @TableField(value = "mold")
    private MoldType mold;
    /**
     * 应用编码
     */
    @Schema(description = "应用编码")
    @TableField(value = "app_code")
    private String appCode;
}
